/*
 * NaluJoiner.h
 *
 *  Created on: 2017年3月27日
 *      Author: chuanjiang.zh
 */

#ifndef NALUJOINER_H_
#define NALUJOINER_H_

#include "BasicType.h"
#include "MFormat.h"
#include "DoubleByteBuffer.h"

namespace av
{

class NaluJoiner
{
public:
	NaluJoiner();
	virtual ~NaluJoiner();

	virtual bool write(const MPacket& inPkt, int naluType, MPacket& outPkt);

	virtual bool isCompleteNalu(int naluType);

protected:
	DoubleByteBuffer	m_buffer;

};


class H264NaluJoiner : public NaluJoiner
{
public:
	virtual bool isCompleteNalu(int naluType);
};


class H265NaluJoiner : public NaluJoiner
{
public:
	virtual bool isCompleteNalu(int naluType);
};


NaluJoiner* createNaluJoiner(int codecID);


} /* namespace av */

#endif /* NALUJOINER_H_ */
